<template>
	<view class="pay-success">
		<view class="main">
			<view class="success">订单支付成功</view>
			<view class="price">支付金额: {{totalPrice | priceFilter}}</view>
		</view>
		<view class="profile" @tap="goProfile">个人中心</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				totalPrice: '',
			};
		},
		onLoad(e) {
			console.log(e.price, '金额')
			this.totalPrice = e.price
		},
		filters: {
			priceFilter(val) {
				return '¥' + (val / 100).toFixed(2)
			}
		},
		methods: {
			goProfile() {
				uni.switchTab({
					url: '/pages/profile/profile'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
.pay-success {
	height: 100vh;
	background-color: #F1ECE7;
	overflow: hidden;
	.profile {
		position: absolute;
		bottom: 80rpx;
		left: 50%;
		transform: translateX(-50%);
		padding: 10rpx 60rpx;
		border: 2rpx solid #333;
		border-radius: 16rpx;
	}
	.main {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 288rpx;
		.success {
			font-size: 48rpx;
			margin-bottom: 20rpx;
			// font-weight: 600;
		}
		.price {
			font-size: 28rpx;
		}
	}
}
</style>
